package com.shardingsphere.shardingsphere.service.impl;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shardingsphere.shardingsphere.mapper.OrderMapper;
import com.shardingsphere.shardingsphere.model.OrderInfo;
import com.shardingsphere.shardingsphere.service.OrderService;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderInfo> implements OrderService {

    @Override
    public IPage<OrderInfo> pageOrderInfos(Page<?> page, OrderInfo orderInfo) {
        Map<String, Object> map = new HashMap<>();
        map.put("userId", orderInfo.getUserId());
        map.put("orderId", orderInfo.getOrderId());
        map.put("orderName", orderInfo.getOrderName());
        map.put("orderStatus", orderInfo.getOrderStatus());
        return super.baseMapper.selectAllByCondition(page, map);
    }
}

